﻿package mortal.game.view.common
{
    import com.gengine.core.*;
    import com.gengine.resource.*;
    import com.gengine.resource.info.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.display.*;
    import com.mui.events.*;
    import com.mui.utils.*;
    import fl.controls.*;
    import fl.data.*;
    import flash.display.*;
    import flash.geom.*;
    import flash.text.*;
    import mortal.common.*;
    import mortal.common.font.*;
    import mortal.common.global.*;
    import mortal.common.label.*;
    import mortal.component.flowerBg.*;
    import mortal.component.gconst.*;
    import mortal.component.processbar.*;
    import mortal.component.skin.combobox.comboboxSkin.*;
    import mortal.component.ui.*;
    import mortal.game.manager.window3d.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.chat.smallChat.*;
    import mortal.game.view.common.button.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.common.pageSelect.*;
    import mortal.game.view.common.tileList.*;
    import mortal.game.view.mainUI.smallMap.view.*;
    import mortal.game.view.vip.panel.*;
    import mortal.game.view.wizard.*;

    public class UIFactory extends Object
    {

        public function UIFactory()
        {
            return;
        }// end function

        public static function sprite(param1:Number = 0, param2:Number = 0, param3:DisplayObjectContainer = null) : Sprite
        {
            var _loc_4:Sprite = null;
            _loc_4 = UICompomentPool.getUICompoment(Sprite) as Sprite;
            _loc_4.mouseEnabled = true;
            _loc_4.mouseChildren = true;
            _loc_4.x = param1;
            _loc_4.y = param2;
            if (param3)
            {
                param3.addChild(_loc_4);
            }
            return _loc_4;
        }// end function

        public static function getUICompoment(param1:Class, param2:Number = 0, param3:Number = 0, param4:DisplayObjectContainer = null, ... args)
        {
            args = UICompomentPool.getUICompomentByParamsArray(param1, args) as param1;
            args.x = param2;
            args.y = param3;
            if (param4)
            {
                param4.addChild(args);
            }
            return args;
        }// end function

        public static function textField(param1:String = "", param2:int = 0, param3:int = 0, param4:int = 220, param5:int = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null, param8:Boolean = false, param9:Boolean = true) : GTextFiled
        {
            return UIFactory.gTextField(param1, param2, param3, param4, param5, param6, param7, param8, param9);
        }// end function

        public static function gTextField(param1:String = "", param2:int = 0, param3:int = 0, param4:int = 220, param5:int = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null, param8:Boolean = false, param9:Boolean = true) : GTextFiled
        {
            var _loc_10:GTextFiled = null;
            _loc_10 = UICompomentPool.getUICompoment(GTextFiled) as GTextFiled;
            _loc_10.defaultTextFormat = param7 ? (param7) : (GlobalStyle.textFormatPutong);
            _loc_10.x = param2;
            _loc_10.y = param3;
            if (param8)
            {
                _loc_10.htmlText = param1;
            }
            else
            {
                _loc_10.text = param1;
            }
            if (param5 > 0)
            {
                _loc_10.height = param5;
            }
            if (param4 > 0)
            {
                _loc_10.width = param4;
            }
            _loc_10.selectable = false;
            _loc_10.multiline = false;
            _loc_10.wordWrap = false;
            _loc_10.embedFonts = false;
            _loc_10.filters = [FilterConst.glowFilter];
            if (param6)
            {
                param6.addChild(_loc_10);
            }
            if (!param9)
            {
                _loc_10.mouseWheelEnabled = false;
            }
            return _loc_10;
        }// end function

        public static function gTextFiledBitmap(param1:String = "", param2:int = 0, param3:int = 0, param4:int = 220, param5:int = 20, param6:DisplayObjectContainer = null, param7:GTextFormat = null, param8:Boolean = false) : GTextFiledBitmap
        {
            var _loc_9:GTextFiledBitmap = null;
            _loc_9 = UICompomentPool.getUICompoment(GTextFiledBitmap) as GTextFiledBitmap;
            _loc_9.bitmapData = new BitmapData(param4, param5, true, 0);
            _loc_9.textFormat = param7 ? (param7) : (GlobalStyle.textFormatPutong);
            _loc_9.x = param2;
            _loc_9.y = param3;
            _loc_9.txtFilters = [FilterConst.glowFilter];
            if (param5 > 0)
            {
                _loc_9.txtHeight = param5;
            }
            if (param4 > 0)
            {
                _loc_9.txtWidth = param4;
            }
            if (param8)
            {
                _loc_9.htmlText = param1;
            }
            else
            {
                _loc_9.text = param1;
            }
            if (param6)
            {
                param6.addChild(_loc_9);
            }
            return _loc_9;
        }// end function

        public static function textArea(param1:String = "", param2:int = 0, param3:int = 0, param4:int = 300, param5:int = 300, param6:DisplayObjectContainer = null, param7:String = "GTextArea") : GTextArea
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GTextArea) as GTextArea;
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.width = param4;
            _loc_8.height = param5;
            _loc_8.wordWrap = true;
            _loc_8.editable = false;
            _loc_8.verticalScrollPolicy = ScrollPolicy.AUTO;
            _loc_8.horizontalScrollPolicy = ScrollPolicy.OFF;
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            _loc_8.styleName = param7;
            return _loc_8;
        }// end function

        public static function embedTextFiled(param1:String, param2:int = 0, param3:int = 0, param4:int = 220, param5:int = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null) : GTextFiled
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GTextFiled) as GTextFiled;
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.height = param5;
            _loc_8.width = param4;
            _loc_8.multiline = false;
            _loc_8.wordWrap = false;
            _loc_8.embedFonts = true;
            _loc_8.mouseEnabled = false;
            _loc_8.autoSize = TextFieldAutoSize.NONE;
            _loc_8.filters = [FilterConst.glowFilter];
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            if (param7)
            {
                _loc_8.defaultTextFormat = param7;
            }
            else
            {
                _loc_8.defaultTextFormat = GlobalStyle.embedNumberTf;
            }
            _loc_8.text = param1;
            return _loc_8;
        }// end function

        public static function autoSizeGTextFiled(param1:String, param2:int, param3:int, param4:int, param5:DisplayObjectContainer, param6:String = "left", param7:int = 3) : GTextFiled
        {
            var _loc_8:* = UIFactory.gTextField(param1, param2, param3, param4, 14, param5);
            _loc_8.wordWrap = true;
            _loc_8.multiline = true;
            _loc_8.autoSize = param6;
            _loc_8.mouseEnabled = false;
            _loc_8.mouseWheelEnabled = false;
            var _loc_9:* = _loc_8.defaultTextFormat;
            _loc_9.leading = param7;
            _loc_8.defaultTextFormat = _loc_9;
            return _loc_8;
        }// end function

        public static function gButton(param1:String, param2:int = 0, param3:int = 0, param4:int = 49, param5:int = 22, param6:DisplayObjectContainer = null, param7:String = "ButtonNew", param8:Boolean = true) : GButton
        {
            var _loc_9:* = UICompomentPool.getUICompoment(GButton) as GButton;
            _loc_9.styleName = param7;
            _loc_9.x = param2;
            _loc_9.y = param3;
            _loc_9.enabled = true;
            _loc_9.setSize(param4, param5);
            _loc_9.isUseFilterSkin = param8;
            _loc_9.textField.filters = [FilterConst.glowFilter];
            _loc_9.label = param1;
            if (param6)
            {
                param6.addChild(_loc_9);
            }
            _loc_9.drawNow();
            return _loc_9;
        }// end function

        public static function gLabelButton(param1:String = null, param2:int = 0, param3:String = "GButton", param4:int = 0, param5:int = 0, param6:int = 60, param7:int = 22, param8:DisplayObjectContainer = null, param9:String = "GBitmap") : GLabelButton
        {
            var _loc_10:* = UICompomentPool.getUICompoment(GLabelButton) as GLabelButton;
            _loc_10.setParams(param1, param2, param3, param6, param7, param9);
            _loc_10.x = param4;
            _loc_10.y = param5;
            if (param8)
            {
                param8.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function gImageButton(param1:String, param2:int = 0, param3:int = 0, param4:int = 60, param5:int = 22, param6:DisplayObjectContainer = null) : GImageButton
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GImageButton) as GImageButton;
            _loc_7.x = param2;
            _loc_7.y = param3;
            _loc_7.width = param4;
            _loc_7.height = param5;
            _loc_7.upSkin = param1;
            if (param6)
            {
                param6.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function timeButton(param1:String, param2:int = 0, param3:int = 0, param4:int = 49, param5:int = 28, param6:DisplayObjectContainer = null, param7:String = null, param8:String = "ButtonNew", param9:Boolean = true) : TimeButton
        {
            var _loc_10:* = UICompomentPool.getUICompoment(TimeButton) as TimeButton;
            _loc_10.styleName = param8;
            _loc_10.x = param2;
            _loc_10.y = param3;
            _loc_10.cacheName = param7;
            _loc_10.setSize(param4, param5);
            _loc_10.isUseFilterSkin = param9;
            _loc_10.textField.filters = [FilterConst.glowFilter];
            _loc_10.label = param1;
            if (param6)
            {
                param6.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function secTimerButton(param1:String, param2:int = 0, param3:int = 0, param4:int = 49, param5:int = 28, param6:DisplayObjectContainer = null, param7:String = "ButtonNew") : SecTimerButton
        {
            var _loc_8:* = UICompomentPool.getUICompoment(SecTimerButton) as SecTimerButton;
            _loc_8 = new SecTimerButton();
            _loc_8.styleName = param7;
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.setSize(param4, param5);
            _loc_8.label = param1;
            if (param6 != null)
            {
                param6.addChild(_loc_8);
            }
            return _loc_8;
        }// end function

        public static function timeLoadingButton(param1:String = "", param2:int = 30000, param3:String = "countDown", param4:String = "", param5:Number = 0, param6:Number = 0, param7:Number = -1, param8:Number = -1, param9:DisplayObjectContainer = null) : TimeLoadingButton
        {
            var _loc_10:* = UICompomentPool.getUICompoment(TimeLoadingButton, param2, param3, param4) as TimeLoadingButton;
            var _loc_11:* = param1.replace("_upSkin", "");
            var _loc_12:* = ResourceConst._scaleMap[_loc_11] as Rectangle;
            if (_loc_12 != null)
            {
                _loc_10.my9Gride = _loc_12;
            }
            _loc_10.styleName = _loc_11;
            _loc_10.label = "";
            _loc_10.x = param5;
            _loc_10.y = param6;
            if (param7 > 0)
            {
                _loc_10.width = param7;
            }
            if (param8 > 0)
            {
                _loc_10.height = param8;
            }
            if (param9)
            {
                param9.addChild(_loc_10);
            }
            _loc_10.drawNow();
            return _loc_10;
        }// end function

        public static function gLoadingButton(param1:String = "", param2:Number = 0, param3:Number = 0, param4:Number = -1, param5:Number = -1, param6:DisplayObjectContainer = null) : GLoadingButton
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GLoadingButton) as GLoadingButton;
            var _loc_8:* = param1.replace("_upSkin", "");
            var _loc_9:* = ResourceConst._scaleMap[_loc_8] as Rectangle;
            if (_loc_9 != null)
            {
                _loc_7.my9Gride = _loc_9;
            }
            _loc_7.styleName = _loc_8;
            _loc_7.label = "";
            _loc_7.x = param2;
            _loc_7.y = param3;
            if (param4 > 0)
            {
                _loc_7.width = param4;
            }
            if (param5 > 0)
            {
                _loc_7.height = param5;
            }
            if (param6)
            {
                param6.addChild(_loc_7);
            }
            _loc_7.drawNow();
            return _loc_7;
        }// end function

        public static function gLoadedButton(param1:String = "", param2:Number = 0, param3:Number = 0, param4:Number = -1, param5:Number = -1, param6:DisplayObjectContainer = null, param7:Boolean = false) : GLoadedButton
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GLoadedButton) as GLoadedButton;
            var _loc_9:* = param1.replace("_upSkin", "");
            var _loc_10:* = ResourceConst._scaleMap[_loc_9] as Rectangle;
            if (_loc_10 != null)
            {
                _loc_8.my9Gride = _loc_10;
            }
            _loc_8.styleName = param1;
            _loc_8.label = "";
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.isUseFilterSkin = param7;
            if (param4 > 0)
            {
                _loc_8.width = param4;
            }
            if (param5 > 0)
            {
                _loc_8.height = param5;
            }
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            return _loc_8;
        }// end function

        public static function gTextInput(param1:int = 0, param2:int = 0, param3:int = 220, param4:int = 20, param5:DisplayObjectContainer = null, param6:String = "GTextInput") : GTextInput
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GTextInput);
            _loc_7.x = param1;
            _loc_7.y = param2;
            _loc_7.width = param3;
            _loc_7.height = param4;
            _loc_7.restrict = null;
            _loc_7.maxChars = 999999999;
            _loc_7.textField.filters = [FilterConst.glowFilter];
            _loc_7.styleName = param6;
            _loc_7.mouseEnabled = true;
            _loc_7.editable = true;
            _loc_7.textField.wordWrap = true;
            _loc_7.textField.autoSize = "left";
            _loc_7.drawNow();
            _loc_7.setStyle("textFormat", GlobalStyle.textFormatBai);
            if (param5)
            {
                param5.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function bg(param1:int = 0, param2:int = 0, param3:int = -1, param4:int = -1, param5:DisplayObjectContainer = null, param6:String = "PanelBg") : ScaleBitmap
        {
            var _loc_7:* = ResourceConst.getScaleBitmap(param6);
            _loc_7.x = param1;
            _loc_7.y = param2;
            if (param3 != -1 && param4 != -1)
            {
                _loc_7.setSize(param3, param4);
            }
            else if (param3 != -1)
            {
                _loc_7.width = param3;
            }
            else if (param4 != -1)
            {
                _loc_7.height = param4;
            }
            if (param5)
            {
                param5.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function label(param1:String, param2:int, param3:int, param4:int = 100, param5:int = 25, param6:String = "left", param7:DisplayObjectContainer = null, param8:Boolean = false, param9:Number = 16777215) : GLabel
        {
            var _loc_10:* = UICompomentPool.getUICompoment(GLabel) as GLabel;
            _loc_10.x = param2;
            _loc_10.y = param3;
            _loc_10.setSize(param4, param5);
            var _loc_11:* = _loc_10.textField.defaultTextFormat;
            _loc_11.align = param6;
            _loc_11.color = param9;
            _loc_11.size = 12;
            _loc_10.setStyle("textFormat", _loc_11);
            _loc_10.htmlText = param1;
            _loc_10.mouseChildren = false;
            _loc_10.mouseEnabled = false;
            _loc_10.textField.filters = null;
            if (param8)
            {
                _loc_10.filters = [FilterConst.glowFilter];
            }
            if (param7)
            {
                param7.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function priceLabel(param1:String, param2:int, param3:int, param4:int = 100, param5:int = 25, param6:String = "left", param7:DisplayObjectContainer = null, param8:Boolean = false, param9:Number = 16777215) : PriceLabel
        {
            var _loc_10:* = UICompomentPool.getUICompoment(PriceLabel) as PriceLabel;
            _loc_10.x = param2;
            _loc_10.y = param3;
            _loc_10.setSize(param4, param5);
            var _loc_11:* = _loc_10.textField.defaultTextFormat;
            _loc_11.align = param6;
            _loc_11.color = param9;
            _loc_10.setStyle("textFormat", _loc_11);
            _loc_10.htmlText = param1;
            if (param8)
            {
                _loc_10.filters = [FilterConst.glowFilter];
            }
            if (param7)
            {
                param7.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function checkBox(param1:String, param2:int = 0, param3:int = 0, param4:int = 100, param5:int = 28, param6:DisplayObjectContainer = null, param7:String = "GCheckBox") : GCheckBox
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GCheckBox) as GCheckBox;
            _loc_8.label = param1;
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.setSize(param4, param5);
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            _loc_8.styleName = param7;
            return _loc_8;
        }// end function

        public static function radioButton(param1:String, param2:int = 0, param3:int = 0, param4:int = 100, param5:int = 28, param6:DisplayObjectContainer = null, param7:String = "GRadioButton") : GRadioButton
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GRadioButton) as GRadioButton;
            _loc_8.label = param1;
            _loc_8.x = param2;
            _loc_8.y = param3;
            _loc_8.setSize(param4, param5);
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            _loc_8.styleName = param7;
            return _loc_8;
        }// end function

        public static function tileList(param1:int = 0, param2:int = 0, param3:int = 100, param4:int = 100, param5:DisplayObjectContainer = null, param6:String = "TileList") : GTileList
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GTileList) as GTileList;
            _loc_7.scrollPolicy = ScrollPolicy.AUTO;
            _loc_7.direction = ScrollBarDirection.VERTICAL;
            _loc_7.styleName = param6;
            _loc_7.setStyle("skin", new Bitmap());
            _loc_7.horizontalGap = 0;
            _loc_7.verticalGap = 0;
            _loc_7.move(param1, param2);
            _loc_7.setSize(param3, param4);
            if (param5)
            {
                param5.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function g3dTileList(param1:int = 0, param2:int = 0, param3:int = 100, param4:int = 100, param5:Rect3DObject = null, param6:DisplayObjectContainer = null, param7:String = "TileList") : G3DTileList
        {
            var _loc_8:* = UICompomentPool.getUICompoment(G3DTileList) as G3DTileList;
            _loc_8.scrollPolicy = ScrollPolicy.AUTO;
            _loc_8.direction = ScrollBarDirection.VERTICAL;
            _loc_8.rect3DObject = param5;
            _loc_8.styleName = param7;
            _loc_8.setStyle("skin", new Bitmap());
            _loc_8.horizontalGap = 0;
            _loc_8.verticalGap = 0;
            _loc_8.move(param1, param2);
            _loc_8.setSize(param3, param4);
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            return _loc_8;
        }// end function

        public static function gScrollPanel(param1:int = 0, param2:int = 0, param3:int = 100, param4:int = 100, param5:DisplayObjectContainer = null, param6:String = "GScrollPane") : GScrollPane
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GScrollPane);
            _loc_7.styleName = param6;
            _loc_7.verticalScrollPolicy = ScrollPolicy.AUTO;
            _loc_7.horizontalScrollPolicy = ScrollPolicy.OFF;
            _loc_7.setStyle("skin", new Bitmap());
            _loc_7.move(param1, param2);
            _loc_7.setSize(param3, param4);
            _loc_7.scrollDrag = false;
            _loc_7.focusEnabled = false;
            if (param5)
            {
                param5.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function pageSelecter(param1:int = 0, param2:int = 0, param3:DisplayObjectContainer = null, param4:String = "简单状态") : PageSelecter
        {
            var _loc_5:* = UICompomentPool.getUICompoment(PageSelecter) as PageSelecter;
            _loc_5.createDisposedChildren();
            _loc_5.x = param1;
            _loc_5.y = param2;
            if (param3)
            {
                param3.addChild(_loc_5);
            }
            _loc_5.mode = param4;
            return _loc_5;
        }// end function

        public static function sortButton(param1:int = 0, param2:int = 0, param3:DisplayObjectContainer = null, param4:int = 1) : SortButton
        {
            var _loc_5:* = UICompomentPool.getUICompoment(SortButton) as SortButton;
            _loc_5.createDisposedChildren();
            _loc_5.x = param1;
            _loc_5.y = param2;
            if (param3)
            {
                param3.addChild(_loc_5);
            }
            _loc_5.mode = param4;
            return _loc_5;
        }// end function

        public static function spBannerAndBg(param1:int = 0, param2:int = 0, param3:Number = 200, param4:Number = 200, param5:String = "", param6:DisplayObjectContainer = null, param7:TextFormat = null) : Sprite
        {
            var _loc_9:TextField = null;
            var _loc_8:* = UIFactory.sprite();
            _loc_8.mouseEnabled = false;
            UIFactory.bg(0, 0, param3, param4, _loc_8);
            UIFactory.bg(-1, -3, param3 + 4, 35, _loc_8, "RbListHeader");
            if (param5)
            {
                if (!param7)
                {
                    param7 = new GTextFormat(FontUtil.songtiName, 14, 15788607);
                    param7.align = TextFormatAlign.CENTER;
                }
                _loc_9 = UIFactory.textField("", 0, 5, param3, 20, _loc_8, param7);
                _loc_9.htmlText = param5;
            }
            _loc_8.x = param1;
            _loc_8.y = param2;
            if (param6)
            {
                param6.addChild(_loc_8);
            }
            return _loc_8;
        }// end function

        public static function bitmap(param1:String = "", param2:Number = 0, param3:Number = 0, param4:DisplayObjectContainer = null) : GBitmap
        {
            var _loc_5:GBitmap = null;
            if (param1)
            {
                _loc_5 = GlobalClass.getBitmap(param1);
            }
            else
            {
                _loc_5 = UICompomentPool.getUICompoment(GBitmap) as GBitmap;
            }
            setObjAttri(_loc_5, param2, param3, -1, -1, param4);
            return _loc_5;
        }// end function

        public static function disposeBitmap(param1:Bitmap, param2:Boolean = true) : void
        {
            if (param1)
            {
                if (param1 is IFrUI)
                {
                    (param1 as IFrUI).dispose();
                }
                else if (param1 is ScaleBitmap)
                {
                    (param1 as ScaleBitmap).dispose(param2);
                }
                else
                {
                    param1.x = 0;
                    param1.y = 0;
                    param1.bitmapData = null;
                    if (param2)
                    {
                        UICompomentPool.disposeUICompoment(param1);
                    }
                }
            }
            return;
        }// end function

        public static function gBitmap(param1:String, param2:Number = 0, param3:Number = 0, param4:DisplayObjectContainer = null) : GBitmap
        {
            var _loc_5:GBitmap = null;
            if (param1)
            {
                _loc_5 = GlobalClass.getBitmap(param1);
            }
            else
            {
                _loc_5 = UICompomentPool.getUICompoment(GBitmap) as GBitmap;
            }
            _loc_5.isDisposed = false;
            setObjAttri(_loc_5, param2, param3, -1, -1, param4);
            return _loc_5;
        }// end function

        public static function disposeGBitmap(param1:GBitmap, param2:Boolean = true) : void
        {
            if (param1)
            {
                param1.x = 0;
                param1.y = 0;
                param1.bitmapData = null;
                param1.smoothing = false;
                if (param2)
                {
                    UICompomentPool.disposeUICompoment(param1);
                }
            }
            return;
        }// end function

        public static function loadedBitmap(param1:String, param2:Number = 0, param3:Number = 0, param4:DisplayObjectContainer = null) : Bitmap
        {
            var bmp:Bitmap;
            var onloaded:Function;
            var url:* = param1;
            var x:* = param2;
            var y:* = param3;
            var parent:* = param4;
            onloaded = function (param1:ImageInfo) : void
            {
                bmp.bitmapData = param1.bitmapData;
                return;
            }// end function
            ;
            bmp = UICompomentPool.getUICompoment(Bitmap);
            setObjAttri(bmp, x, y, -1, -1, parent);
            LoaderManager.instance.load(url, onloaded);
            return bmp;
        }// end function

        public static function gImageBitmap(param1:String, param2:Number = 0, param3:Number = 0, param4:DisplayObjectContainer = null, param5:Function = null) : GImageBitmap
        {
            var _loc_6:* = UICompomentPool.getUICompoment(GImageBitmap);
            if (param5 != null)
            {
                _loc_6.onLoadCompl = param5;
            }
            setObjAttri(_loc_6, param2, param3, -1, -1, param4);
            _loc_6.imgUrl = param1;
            return _loc_6;
        }// end function

        public static function colorBox(param1:Number, param2:Number, param3:int = 16711680, param4:Number = 1) : Sprite
        {
            var _loc_5:* = UICompomentPool.getUICompoment(Sprite) as Sprite;
            _loc_5.graphics.beginFill(param3, param4);
            _loc_5.graphics.drawRect(0, 0, param1, param2);
            _loc_5.graphics.endFill();
            _loc_5.cacheAsBitmap = true;
            return _loc_5;
        }// end function

        public static function disposeSprite(param1:Sprite, param2:Boolean = false) : void
        {
            var _loc_4:int = 0;
            var _loc_5:DisplayObject = null;
            var _loc_3:* = param1.numChildren;
            if (param2)
            {
                _loc_4 = _loc_3 - 1;
                while (_loc_4 >= 0)
                {
                    
                    _loc_5 = param1.getChildAt(_loc_4);
                    param1.removeChildAt(_loc_4);
                    if (_loc_5 is IDispose)
                    {
                        (_loc_5 as IDispose).dispose();
                    }
                    _loc_4 = _loc_4 - 1;
                }
            }
            if (param1.parent)
            {
                param1.parent.removeChild(param1);
            }
            param1.mouseEnabled = true;
            param1.mouseChildren = true;
            UICompomentPool.disposeUICompoment(param1);
            return;
        }// end function

        public static function titleTextField(param1:String, param2:TextFormat = null) : GTextFiled
        {
            var _loc_3:* = UICompomentPool.getUICompoment(GTextFiled) as GTextFiled;
            _loc_3.defaultTextFormat = param2 ? (param2) : (GlobalStyle.windowTitle2);
            _loc_3.filters = [FilterConst.titleFilter, FilterConst.titleShadowFilter];
            _loc_3.selectable = false;
            _loc_3.mouseEnabled = false;
            _loc_3.autoSize = TextFieldAutoSize.LEFT;
            _loc_3.htmlText = param1;
            return _loc_3;
        }// end function

        public static function embedTitleTextField(param1:String) : GTextFiled
        {
            var _loc_2:* = UICompomentPool.getUICompoment(GTextFiled) as GTextFiled;
            _loc_2.mouseEnabled = false;
            _loc_2.embedFonts = true;
            _loc_2.defaultTextFormat = GlobalStyle.windowTitle;
            _loc_2.selectable = false;
            _loc_2.filters = [FilterConst.titleFilter, FilterConst.titleShadowFilter];
            _loc_2.autoSize = TextFieldAutoSize.LEFT;
            _loc_2.htmlText = param1;
            return _loc_2;
        }// end function

        public static function setObjAttri(param1:DisplayObject, param2:Number = 0, param3:Number = 0, param4:Number = -1, param5:Number = -1, param6:DisplayObjectContainer = null) : void
        {
            param1.x = param2;
            param1.y = param3;
            if (param4 > 0)
            {
                param1.width = param4;
            }
            if (param5 > 0)
            {
                param1.height = param5;
            }
            if (param6)
            {
                param6.addChild(param1);
            }
            return;
        }// end function

        public static function gTabBar(param1:int, param2:int, param3:Array, param4:int = 63, param5:int = 22, param6:DisplayObjectContainer = null, param7:Function = null, param8:String = "TabButton") : GTabBar
        {
            var _loc_9:* = UICompomentPool.getUICompoment(GTabBar) as GTabBar;
            _loc_9.x = param1;
            _loc_9.y = param2;
            _loc_9.buttonWidth = param4;
            _loc_9.buttonStyleName = param8;
            _loc_9.buttonHeight = param5;
            _loc_9.horizontalGap = 2;
            _loc_9.buttonFilters = [FilterConst.glowFilter];
            _loc_9.dataProvider = param3;
            if (param7 != null)
            {
                _loc_9.configEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, param7);
            }
            if (param6 != null)
            {
                param6.addChild(_loc_9);
            }
            return _loc_9;
        }// end function

        public static function gTabBarNew(param1:int, param2:int, param3:Array, param4:int, param5:int, param6:int = 63, param7:int = 22, param8:DisplayObjectContainer = null, param9:Function = null, param10:String = "TabButtonNew") : GTabarNew
        {
            var _loc_11:* = UICompomentPool.getUICompoment(GTabarNew) as GTabarNew;
            var _loc_12:* = _loc_11.hasEventListener("GTABBAR_SELECTED_CHANGE");
            _loc_11.setSize(param4, param5);
            _loc_11.x = param1;
            _loc_11.y = param2;
            _loc_11.buttonWidth = param6;
            _loc_11.buttonStyleName = param10;
            _loc_11.buttonHeight = param7;
            _loc_11.horizontalGap = 2;
            _loc_11.buttonFilters = [FilterConst.glowFilter];
            _loc_11.dataProvider = param3;
            if (param9 != null)
            {
                _loc_11.configEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, param9);
            }
            if (param8 != null)
            {
                param8.addChild(_loc_11);
            }
            return _loc_11;
        }// end function

        public static function gComboBox(param1:int, param2:int, param3:int = 100, param4:int = 20, param5:DataProvider = null, param6:DisplayObjectContainer = null, param7:String = "GComboboxStyle") : GComboBox
        {
            var _loc_8:* = UICompomentPool.getUICompoment(GComboBox) as GComboBox;
            _loc_8.move(param1, param2);
            _loc_8.width = param3;
            _loc_8.height = param4;
            _loc_8.buttonMode = true;
            _loc_8.styleName = param7;
            _loc_8.setStyle("textPadding", 0);
            _loc_8.setStyle("textFormat", GlobalStyle.textFormatPutong.center());
            _loc_8.drawNow();
            _loc_8.dropdown.setStyle("skin", ResourceConst.getScaleBitmap(ImagesConst.ComboBg2));
            _loc_8.textField.setStyle("textFormat", GlobalStyle.textFormatPutong.center());
            if (param5)
            {
                _loc_8.dataProvider = param5;
            }
            _loc_8.selectedIndex = 0;
            if (param6 != null)
            {
                param6.addChild(_loc_8);
            }
            _loc_8.dropdown.setStyle("cellRenderer", ComboboxCellRenderer);
            return _loc_8;
        }// end function

        public static function gNumericStepper(param1:int, param2:int, param3:int = 49, param4:int = 22, param5:DisplayObjectContainer = null, param6:int = 99, param7:int = 1, param8:String = "NumericStepper", param9:GTextFormat = null, param10:String = "SetMaxNum") : GNumericStepper
        {
            var _loc_11:* = UICompomentPool.getUICompoment(GNumericStepper) as GNumericStepper;
            _loc_11.style = param10;
            _loc_11.move(param1, param2);
            _loc_11.setSize(param3, param4);
            _loc_11.styleName = param8;
            _loc_11.drawNow();
            _loc_11.textField.setStyle("textFormat", param9);
            _loc_11.textField.drawNow();
            _loc_11.maximum = param6;
            _loc_11.minimum = param7;
            if (param5)
            {
                param5.addChild(_loc_11);
            }
            return _loc_11;
        }// end function

        public static function numInput(param1:int, param2:int, param3:DisplayObjectContainer = null, param4:int = 1, param5:int = 99) : NumInput
        {
            var _loc_6:* = UICompomentPool.getUICompoment(NumInput) as NumInput;
            _loc_6.x = param1;
            _loc_6.y = param2;
            _loc_6.maxNum = param5;
            _loc_6.minNum = param4;
            if (param3)
            {
                param3.addChild(_loc_6);
            }
            return _loc_6;
        }// end function

        public static function secTimeView(param1:String = "mm:ss", param2:Number = 0, param3:Number = 0, param4:Number = 200, param5:Number = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null) : SecTimerView
        {
            var _loc_8:* = UICompomentPool.getUICompoment(SecTimerView) as SecTimerView;
            _loc_8.setParse(param1);
            _loc_8.selectable = false;
            _loc_8.mouseEnabled = false;
            if (param7)
            {
                _loc_8.defaultTextFormat = param7;
            }
            else
            {
                _loc_8.defaultTextFormat = GlobalStyle.textFormatPutong;
            }
            UIFactory.setObjAttri(_loc_8, param2, param3, param4, param5, param6);
            return _loc_8;
        }// end function

        public static function secTimeCountView(param1:String = "mm:ss", param2:Number = 0, param3:Number = 0, param4:Number = 200, param5:Number = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null) : SecTimerCountView
        {
            var _loc_8:* = UICompomentPool.getUICompoment(SecTimerCountView) as SecTimerCountView;
            _loc_8.setParse(param1);
            _loc_8.selectable = false;
            _loc_8.mouseEnabled = false;
            UIFactory.setObjAttri(_loc_8, param2, param3, param4, param5, param6);
            if (param7)
            {
                _loc_8.defaultTextFormat = param7;
            }
            return _loc_8;
        }// end function

        public static function baseItem(param1:int, param2:int, param3:int, param4:int, param5:DisplayObjectContainer = null, param6 = null) : BaseItem
        {
            var _loc_7:* = UICompomentPool.getUICompoment(BaseItem) as BaseItem;
            _loc_7.x = param1;
            _loc_7.y = param2;
            _loc_7.width = param3;
            _loc_7.height = param4;
            if (param5 != null)
            {
                param5.addChild(_loc_7);
            }
            if (param6 != null)
            {
                if (param6 is int)
                {
                    _loc_7.itemData = new ItemData(param6);
                }
                else if (param6 is ItemData)
                {
                    _loc_7.itemData = param6 as ItemData;
                }
            }
            return _loc_7;
        }// end function

        public static function pointProcessBar(param1:int, param2:int, param3:int, param4:int, param5:DisplayObjectContainer = null, param6:String = "PetLifeBg", param7:String = "GreenProcessPoint", param8:int = 5) : PointProcessBar
        {
            var _loc_9:* = UICompomentPool.getUICompoment(PointProcessBar);
            _loc_9.setParams(param6, param7, param3, param4, param8);
            _loc_9.x = param1;
            _loc_9.y = param2;
            if (param5)
            {
                param5.addChild(_loc_9);
            }
            return _loc_9;
        }// end function

        public static function bitmapNumberText(param1:int, param2:int, param3:String, param4:Number, param5:int, param6:int = 2, param7:DisplayObjectContainer = null, param8:int = 13, param9:int = 0) : BitmapNumberText
        {
            var _loc_10:* = UICompomentPool.getUICompoment(BitmapNumberText);
            _loc_10.setSytleName(param3, param4, param5, param6, param8);
            _loc_10.x = param1;
            _loc_10.y = param2;
            _loc_10.align = param9;
            if (param7)
            {
                param7.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function secTimerBitmapView(param1:int, param2:int, param3:String, param4:Number, param5:int, param6:int = 2, param7:DisplayObjectContainer = null, param8:int = 13, param9:int = 0) : SecTimerBitmapView
        {
            var _loc_10:* = UICompomentPool.getUICompoment(SecTimerBitmapView);
            _loc_10.setSytleName(param3, param4, param5, param6, param8);
            _loc_10.x = param1;
            _loc_10.y = param2;
            _loc_10.align = param9;
            if (param7)
            {
                param7.addChild(_loc_10);
            }
            return _loc_10;
        }// end function

        public static function gConsumeBox(param1:String, param2:int, param3:int, param4:int = 60, param5:DisplayObjectContainer = null, param6:int = 12) : GConsumeBox
        {
            var _loc_7:* = UICompomentPool.getUICompoment(GConsumeBox) as GConsumeBox;
            _loc_7.x = param2;
            _loc_7.y = param3;
            _loc_7.gapWide = param4;
            _loc_7.label = param1;
            _loc_7.textSize = param6;
            if (param5)
            {
                param5.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

        public static function smallChatView(param1:int, param2:int, param3:int, param4:int, param5:DisplayObjectContainer = null) : SmallChatView
        {
            var _loc_6:* = UICompomentPool.getUICompoment(SmallChatView, param3, param4);
            _loc_6.scrollPaneW = param3;
            _loc_6.scrollPaneH = param4;
            _loc_6.x = param1;
            _loc_6.y = param2;
            if (param5)
            {
                param5.addChild(_loc_6);
            }
            return _loc_6;
        }// end function

        public static function smallMapEmbedView(param1:String, param2:int, param3:int, param4:DisplayObjectContainer = null, param5:Boolean = false) : SmallMapEmbedView
        {
            var _loc_6:* = UICompomentPool.getUICompoment(SmallMapEmbedView, param5);
            _loc_6.smallMapName = param1;
            _loc_6.showRoleDirection = param5;
            _loc_6.x = param2;
            _loc_6.y = param3;
            if (param4)
            {
                param4.addChild(_loc_6);
            }
            return _loc_6;
        }// end function

        public static function gLinkButton(param1:String = "", param2:int = 0, param3:int = 0, param4:int = 220, param5:int = 20, param6:DisplayObjectContainer = null, param7:TextFormat = null, param8:Boolean = true, param9:Boolean = true) : GLinkButton
        {
            var _loc_10:* = UICompomentPool.getUICompoment(GLinkButton) as GLinkButton;
            _loc_10.defaultTextFormat = param7 ? (param7) : (GlobalStyle.textFormatPutong);
            _loc_10.x = param2;
            _loc_10.y = param3;
            if (param8)
            {
                _loc_10.htmlText = param1;
            }
            else
            {
                _loc_10.text = param1;
            }
            if (param5 > 0)
            {
                _loc_10.height = param5;
            }
            if (param4 > 0)
            {
                _loc_10.width = param4;
            }
            _loc_10.selectable = false;
            _loc_10.multiline = false;
            _loc_10.wordWrap = false;
            _loc_10.embedFonts = false;
            _loc_10.filters = [FilterConst.glowFilter];
            if (param6)
            {
                param6.addChild(_loc_10);
            }
            if (!param9)
            {
                _loc_10.mouseWheelEnabled = false;
            }
            _loc_10.type = TextFieldType.DYNAMIC;
            return _loc_10;
        }// end function

        public static function flowerBg(param1:int = 0, param2:int = 0, param3:int = 220, param4:int = 20, param5:DisplayObjectContainer = null) : FlowerBg
        {
            var _loc_6:* = UICompomentPool.getUICompoment(FlowerBg) as FlowerBg;
            _loc_6.setSize(param3, param4);
            _loc_6.x = param1;
            _loc_6.y = param2;
            if (param5)
            {
                param5.addChild(_loc_6);
            }
            return _loc_6;
        }// end function

        public static function vipOpenTipsPanel(param1:int, param2:int, param3:DisplayObjectContainer, param4:int = -1, param5:int = 2, param6:String = "vipOpenTipsBg_mid") : VipOpenTipsPanel
        {
            var _loc_7:* = UICompomentPool.getUICompoment(VipOpenTipsPanel);
            _loc_7.x = param1;
            _loc_7.y = param2;
            _loc_7.bgUrl = param6;
            _loc_7.valueType = param5;
            _loc_7.vipType = param4;
            if (param3)
            {
                param3.addChild(_loc_7);
            }
            return _loc_7;
        }// end function

    }
}
